import Vue from 'vue'
import Vuex from 'vuex'
import {getList} from "@/api/home"
import vuexLogger from "vuex/dist/logger"
import createPersistedState from "vuex-persistedstate";
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    items:[1,2,3,45,6]
  },
  getters: {
   
  },
  mutations: {
     setMutation(state,payload){
      state.items=payload
     }
  },
  actions: {
   async setAction(state,payload){
      let res=await getList()
     state.commit("setMutation",res.data)
    }
  },
  modules: {
  },
  plugins:[vuexLogger(),createPersistedState()]
})
